home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2001 October / macformat-108.iso / Shareware / Math scientific / PsyScript / scripts / Tools / show click areas / show click areas.rsrc / TEXT_2000_Source Text.txt < prev    next >
Encoding:
Text File  |  2001-04-25  |  1.1 KB  |  33 lines

  1. tell application "PsyScript"
  2.     activate
  3.     begin experiment
  4.     --load function libraries
  5.     set fileHelper to load script file ("" & Psyscript base folder & "libraries:file.lib")
  6.     
  7.     if ((every click area whose noticed is true) = {}) then
  8.         --set bounds of click area index to {left, top, right, bottom} 
  9.         --think of it as {x,y} {x,y}
  10.         set noticed of click area 1 to true
  11.         set bounds of click area 1 to {20, 30, 50, 70}
  12.         set mapping of click area 1 to "top left corner"
  13.         
  14.         set noticed of click area 2 to true
  15.         set bounds of click area 2 to {200, 150, 500, 250}
  16.         set mapping of click area 2 to "number 2"
  17.     else
  18.         --something is noticed
  19.     end if
  20.     set theClicks to {} & (index of every click area whose noticed is true)
  21.     
  22.     repeat with clickAreaIndex in theClicks
  23.         tell click area clickAreaIndex
  24.             set n to bounds
  25.             set areaMapping to mapping
  26.             set centroid to fileHelper's getCentroid(n)
  27.             do trial "'?5'(?1 ?2) '?5'(?3 ?2) '?5'(?1 ?4)  '?5'(?3 ?4) '?6'(?7 ?8)!t(0)" given {} & n & clickAreaIndex & areaMapping & centroid
  28.         end tell
  29.     end repeat
  30.     do trial "'these are the noticed click areas'"
  31.     end experiment
  32. end tell
  33.